<?php

class Pagination
{
	var $page_index;
	var $items_per_page;
        var $total_items;
        private $total_pages;
        private $next;
        private $previous;
        private $first;
        private $last;
        
	function Pagination($total_items = null, $page_index = 0, $items_per_page = 0)
	{
            // Load default items per page value from system
            if ($items_per_page == 0)
                $this->items_per_page = ITEMS_PER_PAGE;
            
            if ($total_items) {
                $this->total_items = $total_items;
                $this->total_pages = ceil($this->total_items / $this->items_per_page);
            }
	}
        
        function __get($key)
	{
            if (property_exists($this, $key))
                return $this->{$key};
            else {
                show_error("Invalid property: $key");
                return false;
            }
	}

	function display()
	{
		
	}
	
}
